Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-38546: fixes while implementing new CalibrateImageTask #181

Merged
merged 7 commits into from
Jul 31, 2023

Conversation

parejkoj
Copy link
Contributor

No description provided.

sourceSelector = sourceSelectorRegistry.makeField(
doc="How to select sources for cross-matching.",
default="science",
optional=True
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm normally in favor of adding doX options since there's such a strong precedent for it, but in this case setting the registry field selection to None seems to express the desired behavior plenty well enough, and unless we add something to validate to check doSourceSelection is False if and only if sourceSelector is None, we're messing up configuration comparisons a bit (though surely not for the first time), by making it so two functionally-equivalent configs with different sourceSelector values but doSourceSelection=False compare as unequal.

It's a pity the DirectMatchConfigWithoutLoader.sourceSelector field is a ConfigurableField and can't be optional, though, and consistency is also desirable.

What do you think about having a do-nothing SourceSelector implementation instead of any of these config field changes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a NullSourceSelectorTask to meas_algorithms and reverted this change.

Conceptually, I don't like it because you should be able to truly do nothing, not even create a numpy array of bools, but that's probably a small enough thing to not be a concern in practice. But yes, I do wish we could just set those registry fields to None and be done with it; revising our uses of them to all use optional registries would be a nice deprecation step, but might be hard to do in practice.

def __init__(self, refObjLoader, schema=None, **kwargs):
RefMatchTask.__init__(self, refObjLoader, **kwargs)
def __init__(self, refObjLoader=None, schema=None, **kwargs):
RefMatchTask.__init__(self, refObjLoader=refObjLoader, **kwargs)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be nice to actually deprecate this argument, but certainly out of scope for this ticket.

Copy link
Contributor Author

@parejkoj parejkoj Jul 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we actually want to deprecate it: I could see uses of it in e.g. notebooks.

My test data had only 3 points, which resulted in a confusing error
inside _get_pair_pattern_statistics(); this at least makes it obvious
when we're in a state that would cause trouble later.
We don't want to do any source selection in the new calibrateImageTask,
as we are selecting sources directly in that task; astrometry and directMatch
source selectors are now optional.
Default config field already has this set.
This was a purely gen2 kwarg.
gen3 pipetasks call setRefObjLoader; users in notebooks and tests may
still want to use the __init__ interface though.
@parejkoj parejkoj merged commit 0a0026d into main Jul 31, 2023
@parejkoj parejkoj deleted the tickets/DM-38546 branch July 31, 2023 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants